class Solution:
    def removeAnagrams(self, words: List[str]) -> List[str]:
        if len(words) == 1:
            return words
        i = 1
        while i < len(words):
            m, n = len(words[i - 1]), len(words[i])
            if m != n: # 长度不一致一定不为异位词
                i += 1
                continue
            dic1 = Counter(words[i])
            dic2 = Counter(words[i - 1])
            # 比较两个字典是否相同
            if dic1 == dic2:
                del words[i]
            else:
                i += 1
        return words
            